package com.supermap.application.controller;

import com.supermap.application.service.EnterpriseProfileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * Created by sun on 2018/2/15.
 * 页面控制层
 */
@Controller
@RequestMapping(value = "/web")
public class IndexController{

    @Autowired
    EnterpriseProfileService enterpriseProfileService;


    @RequestMapping(value = "/test")
    @ResponseBody
    public String test(){
        return "spring boot is sb";
    }

    /**
     * 导航首页
     * @return
     */
    @RequestMapping(value = "/index")
    @ResponseBody
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("index");
        return modelAndView;
    }

    /**
     * 一企一册
     * @return
     */
    @RequestMapping(value = "/enterpriseVolum")
    @ResponseBody
    public ModelAndView enterpriseVolum(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/view/enterpriseVolum");
        return modelAndView;
    }

    /**
     * 联网直报
     * @return
     */
    @RequestMapping(value = "/report")
    @ResponseBody
    public ModelAndView report(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("view/report");
        return modelAndView;
    }

    /**
     * 目标管理
     * @return
     */
    @RequestMapping(value = "/targetManagement")
    @ResponseBody
    public ModelAndView targetManagement(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("target_manage/targetManagement");
        return modelAndView;
    }

    /**
     * 目标管理
     * @return
     */
    @RequestMapping(value = "/inDevelopment")
    @ResponseBody
    public ModelAndView inDevelopment(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("view/inDevelopment");
        return modelAndView;
    }


    /**
     * 外部系统导向一企一册界面控制
     * @return 视图
     */
    @RequestMapping(value = "/enterprise/code")
    @ResponseBody
    public ModelAndView enterpriseProfile(String uniscid){
        ModelAndView modelAndView = new ModelAndView();
        Map map = enterpriseProfileService.getEnterpriseInfoByCode(uniscid);
        modelAndView.addObject("enterprise",map);
        modelAndView.setViewName("view/enterpriseVolum");
        return modelAndView;
    }


    /**
     * 数据看板
     * @return
     */
    @RequestMapping(value = "/dataBoard")
    @ResponseBody
    public ModelAndView dataBoard(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("view/dataBoard");
        return modelAndView;
    }


    /**
     * 平台首页
     * @return
     */
    @RequestMapping(value = "/base")
    @ResponseBody
    public ModelAndView base(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("base");
        return modelAndView;
    }


    /**
     * 首页头部信息
     * @return
     */
    @RequestMapping(value = "/top")
    @ResponseBody
    public ModelAndView top(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("web/top");
        return modelAndView;
    }


    /**
     * 首页版权信息
     * @return
     */
    @RequestMapping(value = "/footer")
    @ResponseBody
    public ModelAndView footer(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("web/footer");
        return modelAndView;
    }


    /**
     * 经济作战地图（地理信息系统）
     * @return
     */
    @RequestMapping(value = "/sgis")
    @ResponseBody
    public ModelAndView sgis(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("economic_fight_map/sgis");
        return modelAndView;
    }



    /**
     * 可视化图库
     * @return
     */
    @RequestMapping(value = "/gallery")
    @ResponseBody
    public ModelAndView gallery(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("gallery/gallery");
        return modelAndView;
    }

    /**
     * 宏观查询
     * @return
     */
    @RequestMapping(value = "/macro")
    @ResponseBody
    public ModelAndView macro(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("macro/macro");
        return modelAndView;
    }


    /**
     * 报表中心
     * @return
     */
    @RequestMapping(value = "/report_center")
    @ResponseBody
    public ModelAndView reportCenter(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("report_center/report_center");
        return modelAndView;
    }


    /**
     * 企业信息查询
     * @return
     */
    @RequestMapping(value = "/enterprise_search")
    @ResponseBody
    public ModelAndView enterpriseSearch(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("macro/enterpriseSearch");
        return modelAndView;
    }



    /**
     * 新区产业结构分析
     * @return
     */
    @RequestMapping(value = "/newTownIndustry")
    @ResponseBody
    public ModelAndView newTownIndustry(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("macro/newTownIndustry");
        return modelAndView;
    }

    /**
     * 新区产业结构分析
     * @return
     */
    @RequestMapping(value = "/system_manage")
    @ResponseBody
    public ModelAndView systemManage(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("system_manage/system_manage");
        return modelAndView;
    }
    /**
     *
     * 宏观经济查询及指标构成
     * @return
     */
    @RequestMapping(value = "/idenForm")
    @ResponseBody
    public ModelAndView idenForm(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("macro/idenForm");
        return modelAndView;
    }

    /**
     * 报表中心
     * @return
     */
    @RequestMapping(value = "/industry_chain")
    @ResponseBody
    public ModelAndView industryChain(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("industry_chain/industry_chain");
        return modelAndView;
    }

    /**
     * 目标考核
     * @return
     */
    @RequestMapping(value = "/target_check")
    @ResponseBody
    public ModelAndView targetCheck(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("target_manage/target_check");
        return modelAndView;
    }
    /**
     * 指标体系
     * @return
     */
    @RequestMapping(value = "/iden")
    @ResponseBody
    public ModelAndView iden(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("iden/iden");
        return modelAndView;
    }
}
